home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 131 / XENIATGM131.iso / Goodies / I-WAR 2 Egde of Chaos - New SDK / IW2-EOC_Pog_Scripting_SDK.exe / include / iCargo.h < prev    next >
C/C++ Source or Header  |  2002-01-14  |  4KB  |  145 lines

  1. //
  2. // (c) 2000 Particle Systems Ltd. All Rights Reserved
  3. //
  4. // iCargo.h
  5. //
  6. // API for the package iCargo.
  7. //
  8. // Revision control information:
  9. //
  10. // $Header: /iwar2/packages/iCargo.h 12    7/03/01 9:24 Tim $
  11. //
  12.  
  13. #include "Flux.h"
  14.  
  15. #ifdef FLUX_COMPILE
  16.  
  17. FLUX_DECLARE_EXTENSION(iCargo);
  18.  
  19. #ifdef FLUX_LIB
  20. #if _MSC_VER >= 1000
  21. #pragma comment( lib, "icargo" )
  22. #endif // _MSC_VER >= 1000
  23. #endif // FLUX_LIB
  24. #else
  25.  
  26. // Cargo type /////////////////////////////////////////////////////////////////
  27.  
  28. handle hcargo : hobject;
  29.  
  30. //
  31. // hcargo has the following properties, which are all straightforward.
  32. //
  33. // string name (From hobject)
  34. //
  35. // int type
  36. // bool player_knows_about
  37. // int value
  38. // bool can_manufacture
  39. // int manufacture_value
  40. // bool can_recycle
  41. // int recycle_value
  42. // string ship_system_template
  43. // string encyclopedia_entry
  44. // bool player_system
  45. //
  46.  
  47. // Cast function //////////////////////////////////////////////////////////////
  48.  
  49. //
  50. // iCargo.Cast
  51. //
  52. // Cast hobject to hcargo
  53. //
  54. prototype hcargo iCargo.Cast( hobject object_handle );
  55.  
  56. // Cargo type management //////////////////////////////////////////////////////
  57.  
  58. //
  59. // iCargo.Create
  60. //
  61. // Define a new type of cargo. Only one cargo may be defined for each value 
  62. // of 'type' - extra definitions will be ignored.
  63. //
  64. // The cargo object is automatically stored in an internal cargo registry so
  65. // no handle is returned. It is normally only necessary to use the type numbers
  66. // when referring to cargoes.
  67. //
  68. prototype iCargo.Create( int type,
  69.                          string name_key,
  70.                          bool player_knows_about,
  71.                          int value,
  72.                          bool can_manufacture,
  73.                          int manufacture_value,
  74.                          bool can_recycle,
  75.                          int recycle_value,
  76.                          string ship_system_template,
  77.                          string encyclopedia_entry,
  78.                          bool player_system );
  79.  
  80. //
  81. // iCargo.Find
  82. //
  83. // Find a type of cargo from its index (it must already have been created)
  84. // and return its handle. If the cargo doesn't exist the return value is 'none'.
  85. //
  86. prototype hcargo iCargo.Find( int type );
  87.  
  88. // Cargo property set and query ///////////////////////////////////////////////
  89.  
  90. //
  91. // All these functions are conveniences for accessing the cargo properties.
  92. //
  93.  
  94. prototype string iCargo.Name( hcargo cargo );
  95.  
  96. prototype bool iCargo.PlayerKnowsAbout( hcargo cargo );
  97.  
  98. prototype int iCargo.Value( hcargo cargo );
  99.  
  100. prototype bool iCargo.CanManufacture( hcargo cargo );
  101. prototype int iCargo.ManufactureValue( hcargo cargo );
  102.  
  103. prototype bool iCargo.CanRecycle( hcargo cargo );
  104. prototype int iCargo.RecycleValue( hcargo cargo );
  105.  
  106. prototype bool iCargo.PlayerSystem( hcargo cargo );
  107.  
  108. prototype string iCargo.ShipSystemTemplate( hcargo cargo );
  109. prototype string iCargo.EncyclopediaEntry( hcargo cargo );
  110.  
  111.  
  112. // 
  113. // All these functions are conveniences for setting the cargo properties. Not
  114. // all are provided since some properties are generally only set at create time.
  115. //
  116.  
  117. prototype iCargo.SetPlayerKnowsAbout( hcargo cargo, bool knows );
  118.  
  119. prototype iCargo.SetValue( hcargo cargo, int value );
  120.  
  121. prototype iCargo.SetCanManufacture( hcargo cargo, bool can_manufacture );
  122. prototype iCargo.SetManufactureValue( hcargo cargo, int value );
  123.  
  124. prototype iCargo.SetCanRecycle( hcargo cargo, bool can_recycle );
  125. prototype iCargo.SetRecycleValue( hcargo cargo, int value );
  126.  
  127. //
  128. // iCargo.MarkInsignificant( hcargo cargo )
  129. //
  130. // Register this cargo type as insignificant cargo...i.e. not worth showing
  131. // to the player
  132. //
  133. prototype iCargo.MarkInsignificant( hcargo cargo );
  134.  
  135. // 
  136. // bool iCargo.Significant( hcargo cargo )
  137. //
  138. // Is this cargo significant?
  139. //
  140. prototype bool iCargo.Significant( hcargo cargo );
  141.  
  142. // EOF ////////////////////////////////////////////////////////////////////////
  143.  
  144. #endif // FLUX_LIB
  145.